class Solution {
    public int findMaxConsecutiveOnes(int[] nums) {
        int n = nums.length;
        int count = 0;
        int len = 0;
        for(int i = 0;i < n;i ++){
            if(nums[i] == 1){
                count ++;
            }else{
                len = Math.max(len,count);
                count = 0;
            }
        }
        len = Math.max(len,count);
        return len;
    }
}